package com.ssi.mrms.action.room;

import static com.opensymphony.xwork2.Action.SUCCESS;

import org.apache.log4j.Logger;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Namespaces;
import org.apache.struts2.convention.annotation.Result;

import com.ssi.mrms.action.BaseAction;
import static com.ssi.mrms.action.BaseAction.lookupBean;
import com.ssi.mrms.model.Msg;
import com.ssi.mrms.model.RMcsdtlModel;
import com.ssi.mrms.service.CarStickerService;
import com.ssi.mrms.service.ComboboxService;
import com.ssi.mrms.view.SelectBoxView;
import java.util.List;

@Namespaces(value = {
    @Namespace("/room")
})
public class RM002AAction extends BaseAction {

    private static final Logger logger = Logger.getLogger(RM002AAction.class);
    private ComboboxService comboboxService = lookupBean(ComboboxService.class, "ComboboxService");
    private CarStickerService carStickerService = lookupBean(CarStickerService.class, "CarStickerService");

    private List<SelectBoxView> comboTower;
    private List<SelectBoxView> comboFloor;
    private List<SelectBoxView> comboUnit;
    private List<SelectBoxView> comboAddress;

    private RMcsdtlModel carStickerDetail;

    public RM002AAction() {

        comboTower = comboboxService.getTower();
        comboFloor = comboboxService.getFloor(null);
        comboUnit = comboboxService.getUnit(null);
        comboAddress = comboboxService.getAddress(null);

    }

    @Action(value = "/RM002A", results = {
        @Result(name = "success", location = "RM002A.tiles", type = "tiles")
    })
    public String init() throws Exception {
        logger.info("## " + this.getClass().getSimpleName());

        carStickerDetail = new RMcsdtlModel();

        return SUCCESS;
    }

    @Action(value = "/RM002Aadd", results = {
        @Result(name = "success", location = "RM002A.tiles", type = "tiles")
    })
    public String save() throws Exception {
        Msg m = new Msg();
        logger.info("## " + this.getClass().getSimpleName());

       
        return SUCCESS;
    }

    public ComboboxService getComboboxService() {
        return comboboxService;
    }

    public void setComboboxService(ComboboxService comboboxService) {
        this.comboboxService = comboboxService;
    }

    public CarStickerService getCarStickerService() {
        return carStickerService;
    }

    public void setCarStickerService(CarStickerService carStickerService) {
        this.carStickerService = carStickerService;
    }

    public List<SelectBoxView> getComboTower() {
        return comboTower;
    }

    public void setComboTower(List<SelectBoxView> comboTower) {
        this.comboTower = comboTower;
    }

    public List<SelectBoxView> getComboFloor() {
        return comboFloor;
    }

    public void setComboFloor(List<SelectBoxView> comboFloor) {
        this.comboFloor = comboFloor;
    }

    public List<SelectBoxView> getComboUnit() {
        return comboUnit;
    }

    public void setComboUnit(List<SelectBoxView> comboUnit) {
        this.comboUnit = comboUnit;
    }

    public List<SelectBoxView> getComboAddress() {
        return comboAddress;
    }

    public void setComboAddress(List<SelectBoxView> comboAddress) {
        this.comboAddress = comboAddress;
    }

    public RMcsdtlModel getCarStickerDetail() {
        return carStickerDetail;
    }

    public void setCarStickerDetail(RMcsdtlModel carStickerDetail) {
        this.carStickerDetail = carStickerDetail;
    }

}
